home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
DATATYPE
/
LINKASRT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-08-18
|
1KB
|
35 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; linked lists with active sorting
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBINI, EFLIBBAS, EFLIBDAT;
var MyText : TextObjectType; Index : word;
begin
with MyText do begin
{ Initialize a structure based on text strings }
Initialize;
{ Enable active sorting with ascending sort order }
SetAscendingOrder;
SetSearchMethod (BinarySearchMethod);
{ Add something to the structure }
AddText ('Kenneth'); AddText ('Adam'); AddText ('Jenny');
AddText ('Clark'); AddText ('Jonathan'); AddText ('Eve');
AddText ('Lucas');
for Index := 1 to Elements do WriteLn (Text(Index));
if IsSorted(AscendingOrder) then WriteLn ('Structure is SORTED!')
else WriteLn ('Structure is NOT SORTED!');
Intercept;
end;
if GlobalDataError then WriteLn ('Error(s) reported!');
end.